<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
#parse("/linkandscript.html")

<title>Login</title>
</head>
<body>        

                <div class="logindiv">
               		$!msg<br>
                	登录$site.getSitename()
                	<table class="logintable" style="width:100%; margin-top:20px;">
                        <tr>
                        	<td style="text-align:right; font-size:12px; ">用户名</td>
                            <td>
                            	<input type="text" class="username" style="width:100px; padding:0px 3px;" value="">
                            </td>
                        </tr>
                        <tr>
                        	<td style="text-align:right; font-size:12px;">密码</td>
                            <td>
                            	<input type="text" class="password" style="width:100px; padding:0px 3px;" value="">
                            </td>
                        </tr>
                    </table>
                    <a id="loginsubmitbtn$forumitem.getId()" class="btn btn-info loginsubmitbtn" site="$site.getId()">提交</a>
                </div>

</body>
<script language="javascript">
$(function(){
	
	$(".loginsubmitbtn").click(function(){
		var site = $(this).attr("site");
		var username = $(this).parent().find(".username").val();
		var password = $(this).parent().find(".password").val();

		$.get('/hezi/site?action=loginsubmit&site='+site+'&forum=$!forum&next=$!next&username='+username+'&password='+password,function(theback)
			  {
				console.log("back:" + theback);
				data = $.parseJSON(theback); 
				
				console.log(data.id);
				console.log(data.code);
				if(data.code == 'ok'){
					consolelog("登录成功");
					//setTimeout('gotoIndex()',500);
					//consolelog(data.next)
					window.location.href=data.next;
				}
				else{
					$(".username").val("");
					$(".password").val("");
					consolelog("登录失败,请重新登录");
				}
			  }
		);	
		
		
	});
	
})


</script>
<style type="text/css">

.logindiv{
	 margin:0 auto;
	 width:210px;
	 text-align:center;
	 border:#eee 4px solid; 
	 padding:10px 10px; 
	 background-color:#FFF;
}






</style>
</html>
